#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;

const int MAXN = 300 + 10;
const int MOD = 1e9 + 7;

int n, w, a[MAXN];
int main() {
#ifdef LOCAL
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
#endif
    ios::sync_with_stdio(false), cin.tie(0);
    cin >> n >> w;
    set<int> s;
    for (int i = 1; i <= n; i++) {
        cin >> a[i];
    }

    for (int i = 1; i <= n; i++) {
        if (a[i] <= w) s.insert(a[i]);
        for (int j = i + 1; j <= n; j++) {
            if (a[i] + a[j] <= w) s.insert(a[i] + a[j]);
            for (int k = j+1; k <= n; k++) {
                 if (a[i] + a[j] + a[k] <= w) s.insert(a[i] + a[j] + a[k]);
            }
        }
    }
    cout << s.size() << endl;
    return 0;
}